﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T4Templates
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(ToPrivateProperty("ChartOfAccount"));
            Console.ReadKey();
            StreamWriter sw = new StreamWriter("D:\\Stubs1.txt");
            var str = "";
            for (int i = 0; i < 200; i++)
            {
                str += "yield return new Airport {Code = " + "Code" + " " + i + ", Name = " + "Name" + " " + i + " };" + "\n";
                sw.WriteLine(str);
            }
            sw.Close();

            //InviteLetter il = new InviteLetter
            //                      {
            //                          AppleId = "abc@gmail.com",
            //                          FirstName = "Huy",
            //                          LastName = "Vu",
            //                          ChangedDate = DateTime.Parse("12/5/2014")
            //                      };
            //il.Session = new Dictionary<string, object>
            //                 {
            //                     {"CreditCardNumber", "**** **** **** 1983" }
            //                 };
            //il.Initialize();
            //Console.WriteLine(il.TransformText());
            //Console.ReadKey();


        }

        static string ToPrivateProperty(string input)
        {
            var firstChar = input.ToCharArray()[0].ToString().ToLower();
            return firstChar + input.Substring(1, input.Length-1);
        }

        public string GetTypeName(string t)
        {
            var strArray = t.Split(new char[] {'.'}, StringSplitOptions.RemoveEmptyEntries);
            return strArray.Last();
        }
    }
}
